package com.example.maxboxtwo.utils.listeners;

import android.view.View;

import com.example.maxboxtwo.R;
import com.example.maxboxtwo.components.function.LED.LEDFunction;
import com.example.maxboxtwo.components.function.LED.Points;

import static java.lang.Thread.sleep;

public class LEDListener implements View.OnClickListener {
    private LEDFunction ledFunction;
    public LEDListener( LEDFunction ledFunction) {
        this.ledFunction = ledFunction;
    }

    @Override
    public void onClick(View v) {
        switch ((int)v.getTag()){
            case R.drawable.led_ico_android:
                //add positions of picture

                break;
            case R.drawable.led_ico_heart:

                ledFunction.setSmall(Points.hreart_one);
                ledFunction.setBig(Points.hreart_two);
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        for(int count=0;count<6;count++){
                            ledFunction.invalidate();
                            try {
                                sleep(1000);
                            } catch (InterruptedException e) {
                                e.printStackTrace();
                            }
                        }
                    }
                }).start();
                break;
            case R.drawable.led_ico_bean:
                //add positions of picture

                break;
            case R.drawable.led_ico_beer:
                //add positions of picture

                break;
            case R.drawable.led_ico_happy:
                //add positions of picture

                break;
            case R.drawable.led_ico_mail:
                //add positions of picture

                break;
            case R.drawable.led_ico_sad:
                //add positions of picture

                break;
            case R.drawable.led_ico_sos:
                //add positions of picture

                break;
        }
    }
}
